//
//  LYYStringWithWidth.m
//  Icar
//
//  Created by dllo on 15/10/19.
//  Copyright © 2015年 小龙侠. All rights reserved.
//

#import "LYYStringWithWidth.h"

@implementation LYYStringWithWidth

+ (CGFloat)WidthWithText:(NSString *)text height:(CGFloat)height font:(UIFont *)font{
    
    CGSize size = CGSizeMake(3000, height);
    CGRect rect = [text boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:font} context:nil];
    return rect.size.width;
}

@end
